package singleton;

public class MySingletonRunner {

	public static void main(String[] args) {
		BasicLazySingleton bls = BasicLazySingleton.getInstance();
		bls.printData();
		System.out.println("Hashcode: " + bls.hashCode());
		
		BasicLazySingleton bls2 = BasicLazySingleton.getInstance();
		bls2.printData();
		System.out.println("Hashcode: " + bls2.hashCode());
		
		System.out.println("\nAre both objects equal: " + (bls == bls2) + "\n\n");
		
		MyEnumSingleton mes = MyEnumSingleton.INSTANCE;
		mes.printData();
		System.out.println("Hashcode: " + mes.hashCode());
		
		MyEnumSingleton mes2 = MyEnumSingleton.INSTANCE;
		mes2.printData();
		System.out.println("Hashcode: " + mes2.hashCode());
		
		System.out.println("\nAre both objects equal: " + (mes == mes2) + "\n\n");
	}

}
